/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Copyright (c) Huawei Technologies Co., Ltd. 2023-2023. All rights reserved.
 * Author: Huawei OS Kernel Lab
 * Create: Thu Aug 15 16:14:23 2023
 */

#ifndef __LIBLINUX_ASM_CACHEFLUSH_H
#define __LIBLINUX_ASM_CACHEFLUSH_H

#ifdef CONFIG_ARM
#define flush_kernel_vmap_range      _flush_kernel_vmap_range
#define invalidate_kernel_vmap_range _invalidate_kernel_vmap_range
#define flush_anon_page              _flush_anon_page
#define flush_kernel_dcache_page     _flush_kernel_dcache_page
#endif

#ifdef CONFIG_ARM64
extern void flush_cache_all(void);
#define flush_cache_all		flush_cache_all
#endif

#include_next <asm/cacheflush.h>

#ifdef CONFIG_ARM
#undef flush_kernel_vmap_range
#undef invalidate_kernel_vmap_range
#undef flush_anon_page
#undef flush_kernel_dcache_page
#undef ARCH_HAS_FLUSH_ANON_PAGE
#undef ARCH_HAS_FLUSH_KERNEL_DCACHE_PAGE

extern void __dma_map_area(const void *, size_t, int);
extern void __dma_unmap_area(const void *, size_t, int);
#endif

#undef  ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE
#define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 0

#endif /* __LIBLINUX_ASM_CACHEFLUSH_H */
